<template>
  <div class="record" @click="showThisDialog">
    <div class="icon">
        <img src="./images/日用品.png">
    </div>
    <div class="detail">
        {{record.describeBill}}
    </div>
    <div class="money">
        {{record.priceType === 0 ? '-'+record.price.toFixed(2):'+'+record.price.toFixed(2)}}
    </div>
  </div>
</template>

<script>
export default {
    name:'CommitRecord',
    props:['record'],
    methods:{
        showThisDialog(){
            this.$bus.$emit('showUpdateDialog');
            const data = {
                createDate:this.record.createDate,
                describe:this.record.describeBill,
                price:this.record.price,
            }
            console.log('a',this.record);
            this.$bus.$emit('initData',data);
        },

    },
    
}
</script>

<style>
    .record{
        height: 7vh;
        border-bottom: solid 1px gray;
        /* background-color: gray; */
    }
    .icon{
        margin-left: 3vw;
        height: 6vh;
        margin-top: 0.5vh;
        width: 6vw;
        line-height: 7vh;
        float: left;
    }
    .icon img{
        height: 6vw;
        width: 6vw;
    }
    .detail{
        float: left;
        margin-left: 3vw;
        line-height: 7vh;
        width: 65vw;
        height: 100%;
        white-space: nowrap;
        color: gray;
        overflow:auto;
        /* background-color: black; */
        scrollbar-width: none; /* Firefox */
    }

    .detail::-webkit-scrollbar {
        display: none; /* Chrome Safari */
    }

    .money{
        float: left;
        width: 13vw;
        line-height: 7vh;
        margin-left: 3vw;
    }
</style>